/**
 * 
 */
package lu.med.praxiswahl.wahlumed.client.briefe;

import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.table.TableColumn;

import lu.med.praxiswahl.wahlumed.client.utilities.ColumnWidthControler;
import lu.med.praxiswahl.wahlumed.client.wclient.Main;

/**
 * @author PatrickPierre
 * 
 */
public class EntryTable extends JTable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7073924788620330952L;

	private ColumnWidthControler c;
	private boolean isColumnWidthChanged;
	private TableColumn resizedColumn;

	private LetterModel model;

	public EntryTable(LetterModel model) {

		this.setModel(model);
		this.model = model;
		this.setTableHeader(tableHeader);
		this.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		this.selectionModel = getSelectionModel();
		this.setRowHeight(30);
		// this.selectionModel
		// .addListSelectionListener(new ZytologieTableSelectionListener(
		// model));
		// this.setDefaultRenderer(Object.class, new
		// ZytologieCellRenderer(model));
		// this.setDefaultEditor(Object.class,
		// new ZytologieCellEditor(model, null));

//		resizedColumn = null;
//
//		c = new ColumnWidthControler(Main.COLUMNWIDTH_CONFIGURATION_FILE,
//				"lettertbl", this);
//
//		for (int i = 0; i < 8; i++) {
//			resizedColumn = this.getColumnModel().getColumn(i);
//			resizedColumn.setPreferredWidth(c.getColumnWidth(i));
//		}
//
//		this.getColumnModel().addColumnModelListener(
//				new TableColumnWidthListener(this));
//		this.getTableHeader().addMouseListener(
//				new TableHeaderMouseListener(this, c));
	}

	public boolean getColumnWidthChanged() {
		return isColumnWidthChanged;
	}

	public void setColumnWidthChanged(boolean widthChanged,
			TableColumn resizedColumn) {
		isColumnWidthChanged = widthChanged;
		this.resizedColumn = resizedColumn;
	}

	public TableColumn getResizedColumn() {
		return resizedColumn;
	}

	public LetterModel getModel() {
		return model;
	}

	
}
